<template>
	<view class="container">
		<view style="width: 100%;height: 20rpx;"></view>
		<view class="list_view">
			<view class="item_view">
				<view class="left_view">
					卡片名称
				</view>
				<view class="right_view">
					{{ dataModel.cardName }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					卡号
				</view>
				<view class="right_view">
					{{ dataModel.cardNo }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					卡片类型
				</view>
				<view class="right_view">
					{{ cardTypeEnum(dataModel.cardType) }}
				</view>
			</view>
			<view class="item_view" @click="numAction()">
				<view class="left_view">
					可开门禁数量
				</view>
				<view class="right_view">
					<u-icon name="arrow-right" :label="dataModel.doorNum" label-pos="left" color="#8A8A8A" size="24"
						label-color="#333333"></u-icon>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				dataModel: {}
			}
		},
		onLoad() {
			this.id = this.$Route.query.id
			this.getCardDetailData()
		},
		methods: {
			cardTypeEnum(e) {
				switch (e) {
					case 1:
						return 'M1卡'
					case 2:
						return 'CPU卡'
					case 3:
						return 'IC卡'
					default:
						break
				}
			},
			numAction() {
				this.$Router.push({
					name: 'numDetail',
					params: {
						device: this.dataModel.device,
						cardName: this.dataModel.cardName
					}
				})
			},
			getCardDetailData() {
				var that = this
				this.$apis.getCardDetail(this.id).then(result => {
					if (result.res.data.code == '200') {
						that.dataModel = result.res.data.data;
					} else {
						that.$show.toastMessage(result.res.data.msg);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #F8F8F8;
	}

	.list_view {
		border-top: 1rpx solid #E8E8E8;

		.item_view {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx;
			background-color: #FFFFFF;
			border-bottom: 1rpx solid #E8E8E8;

			.left_view {
				display: flex;
				flex-direction: row;

				.content_view {
					margin-left: 20rpx;
				}
			}
		}
	}

	.bottom_view {
		width: 100%;
		height: 100rpx;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;

		.again_view {
			width: 35%;
			height: 80rpx;
			border: 2rpx solid #333333;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 5rpx;
		}

		.next_view {
			width: 35%;
			height: 80rpx;
			border: 2rpx solid #333333;
			background-color: blue;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #ffffff;
			border-radius: 5rpx;
		}
	}
</style>